package com.sky.mapper;

import com.sky.annotation.AotuFillInsert;
import com.sky.entity.Dish;
import com.sky.vo.DishVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DishMapper {
@Select("select count(*) from dish where category_id = #{id}")
    Integer countByCategoryId(Long id);

    Integer selectCount(Dish dishQuery);

    @AotuFillInsert
    void insert(Dish dish);

    List<Dish> page(Dish dishQuery);

    Integer selectByIdsAndStatus(List<String> ids, Integer status);

    void deleteById(List<String> ids);
    @Select("select * from dish where id = #{id}")
    Dish selectById(Long id);

    void updateById(Dish dish);

    @Select("select status from sky_take_out.dish where id=#{dishId}")
    Integer select(Long dishId);


    List<DishVO> list(Integer type);
}
